
<?php
require_once 'ConnectionProperties.php';

class ConnectionManager{

	private $connectionProperties;
	static private $instance = null;
	
	private function __construct(){
		$this->connectionProperties = new ConnectionProperties();
	}

	static public function getInstance() {

		if(is_null(self::$instance)){
			self::$instance = new ConnectionManager();
		}
		
		return self::$instance;
	}
	
	
	public function connect($username, $password)
	{
		if (!is_null($this->connectionProperties))
		{
			$ftp_ip = "10.0.7.46:21"; //$this->connectionProperties->getHost();
			if ($ftpp = $ftp_connect($ftp_ip))
			{
				if ($ftp_login($ftpp, $username, $password))
				{
					return true;
				}
				else
				{
					return false;
				}
			}
			else
			{
				return false;
			}
		}
		else
		{
			return false;
		}
	}
}

?>
